﻿#pragma once
#include "Mesh.h"
#include <map>
#include <string>

class vtkUnstructuredGrid;
class vtkDataSet;
class FileMesh : public Mesh
{
public:
  FileMesh(const Configuration& cfg)
    : Mesh(cfg)
    , _mesh_file(Get<std::string>("file")){};
  virtual ~FileMesh(){};

  void Build() override;

protected:
  vtkUnstructuredGrid* MergeGrids(vtkDataSet** sets,
                                  int nsets,
                                  int deleteDataSets,
                                  int useGlobalNodeIds,
                                  float pointMergeTolerance,
                                  int useGlobalCellIds);
  int ReadExodusMesh();
  void FillElementSides(const std::string name, vtkDataSet* const& data_set);

private:
  std::string _mesh_file;
  std::map<std::string, int> _id;
};
